$(function () {
    var loading = weui.loading('loading', {
        className: 'custom-classname'
    });
    // 获取报表信息
    var result = Model.user.reportForms();
    if (!sessionStorage.getItem('hmdj_stopError')) {
        sessionStorage.setItem('hmdj_stopError', true);
    } else {
        if (result.code) {
            Common.fn.formatOutput(result);
            loading.hide();
            return false;
        }
    }
    $('.income').text(result.data.income);
    $('.outcome').text(result.data.outcome);
    $('.last-month-income').text(result.data.last_income);
    $('.last-month-outcome').text(result.data.last_outcome);
    $('.today-income').text(result.data.today_income);
    $('.today-outcome').text(result.data.today_outcome);
    for (var i = 0; i < result.data.day_history.length; i++) {
        var item = '<tr><td>' + result.data.day_history[i].date + '</td><td>' + result.data.day_history[i].day_income + '</td><td>' + result.data.day_history[i].day_outcome + '</td></tr>';
        $('.report-items').append(item);
    }
    loading.hide();
});